class VoiceCallsController < ApplicationController
    def index
        list
        render :action => 'list'
    end

    # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
    verify :method => :post, :only => [ :destroy, :create, :update ],
        :redirect_to => { :action => :list }
    
    def rss
        @voice_calls = VoiceCall.recent
        render :layout => false
    end
    
    def xml
        @voice_calls = VoiceCall.recent
        render :layout => false
    end
    
    def list
        @voice_call_pages, @voice_calls = paginate :voice_calls, :per_page => 10
    end

    def show
        @voice_call = VoiceCall.find(params[:id])
    end

    def new
        @voice_call = VoiceCall.new
    end

    def create
        @voice_call = VoiceCall.new(params[:voice_call])
        if @voice_call.save
            flash[:notice] = 'VoiceCall was successfully created.'
            redirect_to :action => 'list'
        else
            render :action => 'new'
        end
    end

    def edit
        @voice_call = VoiceCall.find(params[:id])
    end

    def update
        @voice_call = VoiceCall.find(params[:id])
        if @voice_call.update_attributes(params[:voice_call])
            flash[:notice] = 'VoiceCall was successfully updated.'
            redirect_to :action => 'show', :id => @voice_call
        else
            render :action => 'edit'
        end
    end

    def destroy
        VoiceCall.find(params[:id]).destroy
        redirect_to :action => 'list'
    end
end
